package 面向对象_中.e多态性.练习3;

/**
 * @Projectname java_based
 * @Filename MyRectangle
 * @Author an
 * @Data 2022/7/2 10:35
 * @Description TODO
 */
public class MyRectangle extends GeometricObject {

    private double width;
    private double height;

    public MyRectangle(double width, double height,String color,double weight) {
        super(color, weight);
        this.height = height;
        this.width = width;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    @Override
    public double findArea() {
        return width * height;
    }
}
